<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <title>{% if page.title %}{{ page.title | escape }}{% else %}{{ site.title | escape }}{% endif %}</title>
  <meta name="description" content="{% if page.excerpt %}{{ page.excerpt | strip_html | strip_newlines | truncate: 160 }}{% else %}{{ site.description }}{% endif %}" />
  <!--[if lte IE 8]><script src="{{ "/js/ie/html5shiv.js" | prepend: site.baseurl }}"></script><![endif]-->
  <link rel="shortcut icon" href="{{ "/images/favicon.ico" | prepend: site.baseurl }}" type="image/x-icon" />
  <link rel="icon" href="{{ "/images/favicon.ico" | prepend: site.baseurl }}" type="image/x-icon" />
  <link rel="canonical" href="{{ page.url | replace:'index.html','' | prepend: site.baseurl | prepend: site.url }}" />
  <link rel="stylesheet" href="{{ "/css/main.css" | prepend: site.baseurl }}" />
  <noscript><link rel="stylesheet" href="/css/noscript.css" /></noscript>

  <!--[if lte IE 8]><link rel="stylesheet" href="{{ "/css/ie8.css" | prepend: site.baseurl }}" /><![endif]-->
  <!--[if lte IE 9]><link rel="stylesheet" href="{{ "/css/ie9.css" | prepend: site.baseurl }}" /><![endif]-->{%
  if page.background-image %}{%
    assign first_char = page.background-image | slice: 0 %}{%
    if first_char == '/' %}{%
      assign second_char = page.background-image | slice: 1 %}{%
      if second_char == '/' %}{% comment %}                     // remote                 {% endcomment %}{%
        assign imageurl = page.background-image %}{%
      else %}{% comment %}                                      // local, not in /images/ {% endcomment %}{%
        assign imageurl = page.background-image | prepend: site.baseurl %}{%
      endif %}{%
    else %}{% comment %}                                        // local, in /images/     {% endcomment %}{%
      assign imageurl = page.background-image | prepend: "/images/" | prepend: site.baseurl %}{%
    endif %}
  <style>
  #main > header {
    background-image: -moz-linear-gradient(top, rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("{{ imageurl }}");
    background-image: -webkit-linear-gradient(top, rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("{{ imageurl }}");
    background-image: -ms-linear-gradient(top, rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("{{ imageurl }}");
    background-image: linear-gradient(top, rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("{{ imageurl }}");
  }
  </style>
  <!--[if lte IE 9]>
  <style>
  #main > header {
    background-image: url("{{ imageurl }}");
  }
  </style>
  -->{%
  endif %}{%
  if page.style-includes %}{%
    for include in page.style-includes %}{%
      assign test1 = include | slice: 0,2 %}{%
      if test1 == "//" %}
  <link rel="stylesheet" href="{{ include }}" />{%
      else %}
  <link rel="stylesheet" href="{{ include | prepend: site.baseurl }}" />{%
      endif %}{%
    endfor %}{%
  endif %}{%
  if page.style %}
<style>
{{ page.style }}
</style>{%
  endif %}
  <link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ "/feed.xml" | prepend: site.baseurl | prepend: site.url }}">
</head>
